package com.zeng.sys.authmd.servicemodule.vo;

import com.zeng.nicecore.convert.AbstractConvertor;
import com.zeng.nicecore.util.BeanUtil;

import java.util.List;

public class TestVo {


    public Test convertToTest() {
        return new TestVoConvertable().voToBean(this);
    }

    public static TestVo convertToTestVo(Test test) {
        return new TestVoConvertable().beanToVo(test);
    }

    public static List<TestVo> listTestVo(List<Test> tests) {
        return new TestVoConvertable().toList(tests);
    }

    public static List<Test> listTest(List<TestVo> testVos) {
        return new TestVoConvertable().toBeanList(testVos);
    }

    private static class TestVoConvertable implements AbstractConvertor<Test, TestVo> {

        @Override
        public TestVo beanToVo(Test test) {
            return BeanUtil.beanToVo(test, new TestVo());
        }

        @Override
        public Test voToBean(TestVo testVo) {
            return BeanUtil.VoToBean(testVo, new Test());
        }
    }
}
